<!-- @@master  = ../../../tpl/base.html-->
<!-- @@block  =  content-->
<section class="panel panel-default">
<header class="panel-heading">
  修改密码
<span class="tools pull-right">
    <a class="fa fa-chevron-down" href="javascript:;"></a>
    <a class="fa fa-times" href="javascript:;"></a>
</span>
</header>
<div class="panel-body">
  <div class="form col-sm-12  col-lg-10">
      <form class="cmxform form-horizontal adminex-form" id="changePwd" method="get" action="">
        <div class="form-group source">
            <label for="app_store_name" class="control-label col-sm-2">旧的密码</label>
            <div class="col-sm-6">
                <input class=" form-control" type="password" name="older" required/>
            </div>
        </div>
        <div class="form-group source">
            <label for="app_store_name" class="control-label col-sm-2">新的密码</label>
            <div class="col-sm-6">
                <input class=" form-control" type="password" name="newer" required/>
            </div>
        </div>
        <div class="form-group source">
            <label for="app_store_name" class="control-label col-sm-2">重复密码</label>
            <div class="col-sm-6">
                <input class=" form-control" type="password" id="repeat_pass"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-6">
                <button class="btn btn-primary" type="submit">确定修改</button>
            </div>
        </div>
      </form>
  </div>

</div>
</section>
<!-- @@close-->
<!-- @@block  =  foot-->
<!--dynamic table-->
<script type="text/javascript">
(function() {
    "use strict";
    $("#changePwd").validate({
      messages:{
        older:"旧的密码不能为空",
        newer:"新的密码不能为空"
      },
      submitHandler:function(form){
        if(form.newer.value != $("#repeat_pass").val()){
            mygritter("两次密码输入不一致");
            return;
        }
        var params = myHttp.getFormJson(form);
        $.isLoading({text:"loading"});
        myHttp.postJSON("channel/password",params,function(data){
          $.isLoading("hide");
          mygritter("修改成功即将重新登录...");
          setTimeout(function(){
            $.isLoading("hide");
            window.location.href = "/login.html"
          },1000);
        },function(msg){
          $.isLoading("hide");
          mygritter(msg);
        });
      }
    });
})(jQuery);
</script>
<!-- @@close-->
